home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / catD / scsi_command.z / scsi_command
Encoding:
Text File  |  1998-10-30  |  3.3 KB  |  67 lines

  1.  
  2.  
  3.  
  4. ssssccccssssiiii____ccccoooommmmmmmmaaaannnndddd((((DDDD3333XXXX))))                                            ssssccccssssiiii____ccccoooommmmmmmmaaaannnndddd((((DDDD3333XXXX))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      scsi_command - issue a command to a SCSI device
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ssssccccssssiiii....hhhh>>>>
  14.  
  15.      vvvvooooiiiidddd
  16.      ((((****ssssccccssssiiii____ccccoooommmmmmmmaaaannnndddd[[[[]]]]))))((((ssssttttrrrruuuucccctttt ssssccccssssiiii____rrrreeeeqqqquuuueeeesssstttt ****_r_e_q))));;;;
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      _s_c_s_i__c_o_m_m_a_n_d issues a command to a SCSI device.  The caller (a kernel
  20.      level SCSI device driver) fills out a scsi_request structure and passes a
  21.      pointer to it.
  22.  
  23.      The _s_r__l_u_n__v_h_d_l field of the request structure must contain the vertex
  24.      handle of the device.  A kernel panic will result if this is not done.
  25.  
  26.      The _s_r__n_o_t_i_f_y field (address of call back function) must be filled in.
  27.      Calls with NULL in _s_r__n_o_t_i_f_y return with a failure indication in the
  28.      _s_r__s_t_a_t_u_s field.  Earlier versions of IRIX allowed the driver to pass a
  29.      NULL callback address in _s_r__n_o_t_i_f_y as a way of asking _s_c_s_i__c_o_m_m_a_n_d to
  30.      suspend the caller until the command completed.  Now if the driver needs
  31.      to sleep until the command completes, create a semaphore that is posted
  32.      from the callback function.
  33.  
  34.      Other fields of the request structure are also required in order to make
  35.      a successful request; see the SCSI chapter of the _I_R_I_X _D_e_v_i_c_e _D_r_i_v_e_r
  36.      _P_r_o_g_r_a_m_m_e_r'_s _G_u_i_d_e and the comments in the scsi.h header file.
  37.  
  38.      Success or failure of the request is indicated by values returned in
  39.      fields in the request structure.
  40.  
  41. NNNNOOOOTTTTEEEESSSS
  42.      _s_c_s_i__c_o_m_m_a_n_d is stored as a function pointer in the information hanging
  43.      off the vertex handle corresponding to the host adapter in the hwgraph.
  44.      Given a _l_u_n__v_h_d_l (vertex handle of the device) the scsi_command function
  45.      can be called as follows:
  46.  
  47.               scsi_lun_info_t *scsi_lun_info;
  48.             ...
  49.               scsi_lun_info = scsi_lun_info_get(lun_vhdl);
  50.               SLI_COMMAND(scsi_lun_info)(scsi_request);
  51.  
  52.  
  53. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  54.      comments in /usr/include/sys/scsi.h, hwgraph.intro(D4X), scsi_alloc(D3X),
  55.      scsi_free(D3X), scsi_info(D3X), scsi_ioctl(D3X), scsi_abort(D3X), SCSI
  56.      chapter of the IRIX Device Driver Programmer's Guide
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.